import React from "react";
import { Carousel } from 'antd';
import "../../../static/css/mobile/hot.less";

export default class Lunbo extends React.Component{
	constructor(){
		super();
		this.state = {
			dataList:[]
		}
	}
	componentDidMount(){
		var result = fetch("http://www.wwtliu.com/sxtstu/news/juhenews.php?type=keji&count=6",{
			method:"get"
		})
		.then(res => {
			return res.json();
		})
		.then(json => {
			this.setState({
				dataList:json
			})
		})
	}
	render(){
		var {dataList}=this.state;
		//console.log(dataList)
		return (
			<Carousel autoplay infinite >
				{
					dataList.map((item,index) => {
						return(
							<div key={item.uniquekey}>
								<img src={item.thumbnail_pic_s}/>
							</div>
						)
					})
				}
			</Carousel>
		)
	}
}